package com.cdtu.stocksage.goods.service.impl;

import java.util.List;
import com.cdtu.stocksage.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cdtu.stocksage.goods.mapper.ErsGoodsOutDetailMapper;
import com.cdtu.stocksage.goods.domain.ErsGoodsOutDetail;
import com.cdtu.stocksage.goods.service.IErsGoodsOutDetailService;

/**
 * 物资出库明细Service业务层处理
 * 
 * @author SL
 * @date 2025-03-12
 */
@Service
public class ErsGoodsOutDetailServiceImpl implements IErsGoodsOutDetailService 
{
    @Autowired
    private ErsGoodsOutDetailMapper ersGoodsOutDetailMapper;

    /**
     * 查询物资出库明细
     * 
     * @param id 物资出库明细主键
     * @return 物资出库明细
     */
    @Override
    public ErsGoodsOutDetail selectErsGoodsOutDetailById(String id)
    {
        return ersGoodsOutDetailMapper.selectErsGoodsOutDetailById(id);
    }

    /**
     * 查询物资出库明细列表
     * 
     * @param ersGoodsOutDetail 物资出库明细
     * @return 物资出库明细
     */
    @Override
    public List<ErsGoodsOutDetail> selectErsGoodsOutDetailList(ErsGoodsOutDetail ersGoodsOutDetail)
    {
        return ersGoodsOutDetailMapper.selectErsGoodsOutDetailList(ersGoodsOutDetail);
    }

    /**
     * 新增物资出库明细
     * 
     * @param ersGoodsOutDetail 物资出库明细
     * @return 结果
     */
    @Override
    public int insertErsGoodsOutDetail(ErsGoodsOutDetail ersGoodsOutDetail)
    {
        ersGoodsOutDetail.setCreateTime(DateUtils.getNowDate());
        return ersGoodsOutDetailMapper.insertErsGoodsOutDetail(ersGoodsOutDetail);
    }

    /**
     * 修改物资出库明细
     * 
     * @param ersGoodsOutDetail 物资出库明细
     * @return 结果
     */
    @Override
    public int updateErsGoodsOutDetail(ErsGoodsOutDetail ersGoodsOutDetail)
    {
        ersGoodsOutDetail.setUpdateTime(DateUtils.getNowDate());
        return ersGoodsOutDetailMapper.updateErsGoodsOutDetail(ersGoodsOutDetail);
    }

    /**
     * 批量删除物资出库明细
     * 
     * @param ids 需要删除的物资出库明细主键
     * @return 结果
     */
    @Override
    public int deleteErsGoodsOutDetailByIds(String[] ids)
    {
        return ersGoodsOutDetailMapper.deleteErsGoodsOutDetailByIds(ids);
    }

    /**
     * 删除物资出库明细信息
     * 
     * @param id 物资出库明细主键
     * @return 结果
     */
    @Override
    public int deleteErsGoodsOutDetailById(String id)
    {
        return ersGoodsOutDetailMapper.deleteErsGoodsOutDetailById(id);
    }
}
